/*
 * Copyright (c) 2010 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.api.data.gdata.v2.model;

import com.google.api.client.util.Key;

/**
 * An email address associated with the containing entity (which is usually an
 * entity representing a person or a location).
 * 
 * @since 2.2
 * @author Nicolas Garnier
 */
public class Email {

  /** Indicates that the email is a personal email. */
  public static final String TYPE_HOME = "http://schemas.google.com/g/2005#home";

  /** Indicates that the email is a work email. */
  public static final String TYPE_WORK = "http://schemas.google.com/g/2005#work";
  /**
   * An email address that is neither home nor work. label can be used to
   * indicate the actual type.
   */
  public static final String TYPE_OTHER = "http://schemas.google.com/g/2005#other";

  /** Email address. */
  @Key("@address")
  public String address;

  /**
   * A programmatic value that identifies the type of email; see below for
   * details. Valid values are {@link #TYPE_HOME}, {@link #TYPE_OTHER} and
   * {@link #TYPE_WORK}.
   */
  @Key("@rel")
  public String type;

  /** A display name of the entity (e.g. a person) the email address belongs to. */
  @Key("@displayName")
  public String displayName;

  /**
   * When multiple email extensions appear in a contact kind, indicates which is
   * primary. At most one email may be primary. Default value is "false".
   */
  @Key("@primary")
  public Boolean primary;

  /**
   * A simple string value used to name this email address. It allows UIs to
   * display a label such as "Work", "Personal", "Preferred", etc.
   */
  @Key("@label")
  public String label;
}
